﻿<%@ Page Title="CBOption交易資料" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="CBOptionTrade.aspx.cs" Inherits="CBOptionTrade"%>

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <style type="text/css">
        .style4
        {
            color: #FF0000;
        }
    </style>
    </asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <p>
        資料日期：<asp:TextBox ID="reportDate" runat="server"></asp:TextBox>
    &nbsp;
        <asp:Button ID="queryBtn" runat="server" Text="取得交易資料" 
            onclick="queryBtn_Click" />
    &nbsp;<asp:Button ID="exportToCsv" runat="server" onclick="exportToCsv_Click" 
            Text="匯出到CSV" />
    </p>
    <p>
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
            DataSourceID="SqlDataSource1" DataKeyNames="id" CellPadding="4" 
            ForeColor="#333333" GridLines="None">
            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
            <Columns>
                <asp:BoundField DataField="ProductType" HeaderText="ProductType" 
                    SortExpression="ProductType" />
                <asp:BoundField DataField="SequenceNo" HeaderText="SequenceNo" 
                    SortExpression="SequenceNo" />
                <asp:BoundField DataField="BankCode" HeaderText="BankCode" 
                    SortExpression="BankCode" />
                <asp:BoundField DataField="BankType" HeaderText="BankType" 
                    SortExpression="BankType" />
                <asp:BoundField DataField="TransUnit" HeaderText="TransUnit" 
                    SortExpression="TransUnit" />
                <asp:BoundField DataField="CptyType" HeaderText="CptyType" 
                    SortExpression="CptyType" />
                <asp:BoundField DataField="CptyName" HeaderText="CptyName" 
                    SortExpression="CptyName" />
                <asp:BoundField DataField="CptyCode" HeaderText="CptyCode" 
                    SortExpression="CptyCode" />
                <asp:BoundField DataField="TransReason" HeaderText="TransReason" 
                    SortExpression="TransReason" />
                <asp:BoundField DataField="TradeDate" HeaderText="TradeDate" 
                    SortExpression="TradeDate" DataFormatString="{0:d}" />
                <asp:BoundField DataField="EffectiveDate" HeaderText="EffectiveDate" 
                    SortExpression="EffectiveDate" DataFormatString="{0:d}" />
                <asp:BoundField DataField="MaturityDate" HeaderText="MaturityDate" 
                    SortExpression="MaturityDate" DataFormatString="{0:d}" />
                <asp:BoundField DataField="FirstPayRecCcy" HeaderText="FirstPayRecCcy" 
                    SortExpression="FirstPayRecCcy" />
                <asp:BoundField DataField="FirstPayRecAmt" HeaderText="FirstPayRecAmt" 
                    SortExpression="FirstPayRecAmt" />
                <asp:BoundField DataField="NotionalCcy" HeaderText="NotionalCcy" 
                    SortExpression="NotionalCcy" />
                <asp:BoundField DataField="NotionalAmt" HeaderText="NotionalAmt" 
                    SortExpression="NotionalAmt" />
                <asp:BoundField DataField="UnderlingType" HeaderText="UnderlingType" 
                    SortExpression="UnderlingType" />
                <asp:BoundField DataField="UnderlingDetail" HeaderText="UnderlingDetail" 
                    SortExpression="UnderlingDetail" />
                <asp:BoundField DataField="LongTermType" HeaderText="LongTermType" 
                    SortExpression="LongTermType" />
                <asp:BoundField DataField="LongTermPrice" HeaderText="LongTermPrice" 
                    SortExpression="LongTermPrice" />
                <asp:BoundField DataField="LongTermMode" HeaderText="LongTermMode" 
                    SortExpression="LongTermMode" />
                <asp:BoundField DataField="OptContractKind" HeaderText="OptContractKind" 
                    SortExpression="OptContractKind" />
                <asp:BoundField DataField="OptContractType" HeaderText="OptContractType" 
                    SortExpression="OptContractType" />
                <asp:BoundField DataField="OptContractPrice" HeaderText="OptContractPrice" 
                    SortExpression="OptContractPrice" />
                <asp:BoundField DataField="OptionStyle" HeaderText="OptionStyle" 
                    SortExpression="OptionStyle" />
                <asp:BoundField DataField="OptionSettleType" HeaderText="OptionSettleType" 
                    SortExpression="OptionSettleType" />
                <asp:BoundField DataField="ExchangeTrnsType" HeaderText="ExchangeTrnsType" 
                    SortExpression="ExchangeTrnsType" />
                <asp:BoundField DataField="ExchangeRollType" HeaderText="ExchangeRollType" 
                    SortExpression="ExchangeRollType" />
                <asp:BoundField DataField="isCompounding" HeaderText="isCompounding" 
                    SortExpression="isCompounding" />
                <asp:BoundField DataField="RateSettleType" HeaderText="RateSettleType" 
                    SortExpression="RateSettleType" />
                <asp:BoundField DataField="IndexType" HeaderText="IndexType" 
                    SortExpression="IndexType" />
                <asp:BoundField DataField="RollDateType" HeaderText="RollDateType" 
                    SortExpression="RollDateType" />
                <asp:BoundField DataField="FixRate" HeaderText="FixRate" 
                    SortExpression="FixRate" />
                <asp:BoundField DataField="FixPaySchedule" HeaderText="FixPaySchedule" 
                    SortExpression="FixPaySchedule" />
                <asp:BoundField DataField="FixBasis" HeaderText="FixBasis" 
                    SortExpression="FixBasis" />
                <asp:BoundField DataField="FloatIndex" HeaderText="FloatIndex" 
                    SortExpression="FloatIndex" />
                <asp:BoundField DataField="FloatIntTermType" HeaderText="FloatIntTermType" 
                    SortExpression="FloatIntTermType" />
                <asp:BoundField DataField="FloatTerm" HeaderText="FloatTerm" 
                    SortExpression="FloatTerm" />
                <asp:BoundField DataField="FloatResetType" HeaderText="FloatResetType" 
                    SortExpression="FloatResetType" />
                <asp:BoundField DataField="FloatSpread" HeaderText="FloatSpread" 
                    SortExpression="FloatSpread" />
                <asp:BoundField DataField="FloatBasis" HeaderText="FloatBasis" 
                    SortExpression="FloatBasis" />
                <asp:BoundField DataField="EquityPayCycle" HeaderText="EquityPayCycle" 
                    SortExpression="EquityPayCycle" />
                <asp:BoundField DataField="EquityParticipate" HeaderText="EquityParticipate" 
                    SortExpression="EquityParticipate" />
            </Columns>
            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
            <EmptyDataTemplate>
                您輸入的資料日期，目前查無符合資料！
            </EmptyDataTemplate>
            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <EditRowStyle BackColor="#999999" />
            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:FEIBConnectionString %>" 
            
            SelectCommand="SELECT * FROM [TR_FormatA_TED] WHERE (([TradeDate] = @TradeDate) AND ([TradeType] = @TradeType))">
            <SelectParameters>
                <asp:ControlParameter ControlID="reportDate" Name="TradeDate" 
                    PropertyName="Text" Type="DateTime" />
                <asp:Parameter DefaultValue="CBOption" Name="TradeType" Type="String" />
            </SelectParameters>
        </asp:SqlDataSource>
&nbsp;<asp:CalendarExtender ID="reportDate_CalendarExtender" runat="server" 
            Enabled="True" Format="yyyy/MM/dd" TargetControlID="reportDate">
        </asp:CalendarExtender>
    </p>
</asp:Content>

